import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
   {
      path: '/',
      name: 'Layout',
      component: () => import(`../components/Layout.vue`),
      redirect: '/home', // 默认跳转到Home页面，重定向
      children: [
         {
            path: '/home',
            name: 'Home',
            component: () => import(`../views/Home.vue`),
         }
      ]
   },
   {
      path: '/login',
      name: 'Login',
      component: () => import(`../views/login/Index.vue`),
   },
   {
      path: '/*',
      redirect: '/',
   },
]

const router = createRouter({
   history: createWebHashHistory(),
   routes
})
export default router